package com.smartcruise.report;

import android.content.Context;
import android.content.Intent;

import com.smartcruise.R;
import com.smartcruise.base.BaseTitleActivity;
import com.smartcruise.base.TitleBuilder;
import com.smartcruise.util.IntentUtils;

import butterknife.BindView;
import fm.jiecao.jcvideoplayer_lib.JCVideoPlayerStandard;

/**
 * Created by FengChaoQun
 * on 2018/1/25 0025
 */

public class VideoPlayerActivity extends BaseTitleActivity {
    @BindView(R.id.videoPlayer)
    JCVideoPlayerStandard videoPlayer;

    private String path;

    public static void start(Context context, String path) {
        Intent intent = new Intent(context, VideoPlayerActivity.class);
        intent.putExtra(IntentUtils.DATA, path);
        context.startActivity(intent);
    }

    @Override
    protected void init() {
        path = getIntent().getStringExtra(IntentUtils.DATA);
        videoPlayer.setUp(path, JCVideoPlayerStandard.SCREEN_LAYOUT_NORMAL, "");
    }

    @Override
    protected int getContentLayout() {
        return R.layout.activity_container_video_player;
    }

    @Override
    protected TitleBuilder getTitleBuilder() {
        return TitleBuilder.create(true, "预览");
    }

}
